package com.wink_172.library;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.util.Log;



public class GobalReceiver extends BroadcastReceiver {

    private static final String TAG = "TAG";
    //命令行发送广播  请注意需要在manifest.xml中注册

    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent == null) {
            return;
        }

        String action = intent.getAction();
        Uri uri = intent.getData();

        // uri --> android_secret_code://1234
        //  host  -->  1234
        String host = uri.getHost();
        Log.e(TAG, "onReceice====>>" + action + "  host:" + host);//监听键盘指令
        if ("1001".equals(host)) {


        } else if ("2807".equals(host)) {
//            Intent intent2 = new Intent(AppManager.getAppManager().currentActivity(), LanguageActivity.class);
//            intent2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
//            context.startActivity(intent2);

        }

    }
}
